<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        //set方法
        let arr=[1,2,7,4,8,2,5,9,8,6];
        let  a=new Set(arr);
        console.log(a);
        console.log(a.size);
        let b=a.add(22);
        console.log(b);
        let c=b.delete(22);
        console.log(c);
        console.log(b);
        let d=a.has(6);
        console.log(d);
        a.clear(a);
        //不用接受值
        console.log(a)
    </script>
</body>

</html>